_c_o_o_r_d Specifies a texture coordinate. Must be one of GGGGLLLL____SSSS, GGGGLLLL____TTTT, GGGGLLLL____RRRR,
or GGGGLLLL____QQQQ.
_p_n_a_m_e Specifies the symbolic name of the texture-coordinate generation
function. Must be GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____GGGGEEEENNNN____MMMMOOOODDDDEEEE.
_p_a_r_a_m Specifies a single-valued texture generation parameter, one of
GGGGLLLL____OOOOBBBBJJJJEEEECCCCTTTT____LLLLIIIINNNNEEEEAAAARRRR, GGGGLLLL____EEEEYYYYEEEE____LLLLIIIINNNNEEEEAAAARRRR, or GGGGLLLL____SSSSPPPPHHHHEEEERRRREEEE____MMMMAAAAPPPP.
single symbolic constant, one of GGGGLLLL____OOOOBBBBJJJJEEEECCCCTTTT____LLLLIIIINNNNEEEEAAAARRRR, GGGGLLLL____EEEEYYYYEEEE____LLLLIIIINNNNEEEEAAAARRRR, or
GGGGLLLL____SSSSPPPPHHHHEEEERRRREEEE____MMMMAAAAPPPP. Otherwise, _p_a_r_a_m_s holds the coefficients for the
texture-coordinate generation function specified by _p_n_a_m_e.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
ggggllllTTTTeeeexxxxGGGGeeeennnn selects a texture-coordinate generation function or supplies
coefficients for one of the functions. _c_o_o_r_d names one of the (_s, _t, _r,
_q) texture coordinates; it must be one of the symbols GGGGLLLL____SSSS, GGGGLLLL____TTTT, GGGGLLLL____RRRR,
or GGGGLLLL____QQQQ. _p_n_a_m_e must be one of three symbolic constants:
GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____GGGGEEEENNNN____MMMMOOOODDDDEEEE, GGGGLLLL____OOOOBBBBJJJJEEEECCCCTTTT____PPPPLLLLAAAANNNNEEEE, or GGGGLLLL____EEEEYYYYEEEE____PPPPLLLLAAAANNNNEEEE. If _p_n_a_m_e is
GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____GGGGEEEENNNN____MMMMOOOODDDDEEEE, then _p_a_r_a_m_s chooses a mode, one of GGGGLLLL____OOOOBBBBJJJJEEEECCCCTTTT____LLLLIIIINNNNEEEEAAAARRRR,
GGGGLLLL____EEEEYYYYEEEE____LLLLIIIINNNNEEEEAAAARRRR, or GGGGLLLL____SSSSPPPPHHHHEEEERRRREEEE____MMMMAAAAPPPP. If _p_n_a_m_e is either GGGGLLLL____OOOOBBBBJJJJEEEECCCCTTTT____PPPPLLLLAAAANNNNEEEE or
GGGGLLLL____EEEEYYYYEEEE____PPPPLLLLAAAANNNNEEEE, _p_a_r_a_m_s contains coefficients for the corresponding texture
generation function.
If the texture generation function is GGGGLLLL____OOOOBBBBJJJJEEEECCCCTTTT____LLLLIIIINNNNEEEEAAAARRRR, the function
g = p x + p y + p z + p w
1 o 2 o 3 o 4 o
is used, where g is the value computed for the coordinate named in _c_o_o_r_d,
p , p , p , and p are the four values supplied in _p_a_r_a_m_s, and x , y ,
1 2 3 4 o o
z , and w are the object coordinates of the vertex. This function can
o o
be used, for example, to texture-map terrain using sea level as a
reference plane (defined by p , p , p , and p ). The altitude of a
1 2 3 4
terrain vertex is computed by the GGGGLLLL____OOOOBBBBJJJJEEEECCCCTTTT____LLLLIIIINNNNEEEEAAAARRRR coordinate generation
function as its distance from sea level; that altitude can then be used
to index the texture image to map white snow onto peaks and green grass
onto foothills.
If the texture generation function is GGGGLLLL____EEEEYYYYEEEE____LLLLIIIINNNNEEEEAAAARRRR, the function
' ' ' '
g = p x + p y + p z + p w
1 e 2 e 3 e 4 e
is used, where
' ' ' ' -1
(p p p p ) = (p p p p ) M
1 2 3 4 1 2 3 4
and x , y , z , and w are the eye coordinates of the vertex, p , p , p ,
e e e e 1 2 3
and p are the values supplied in _p_a_r_a_m_s, and M is the modelview matrix
4
when ggggllllTTTTeeeexxxxGGGGeeeennnn is invoked. If M is poorly conditioned or singular,
texture coordinates generated by the resulting function may be inaccurate
or undefined.
Note that the values in _p_a_r_a_m_s define a reference plane in eye
coordinates. The modelview matrix that is applied to them may not be the
same one in effect when the polygon vertices are transformed. This
function establishes a field of texture coordinates that can produce
dynamic contour lines on moving objects.
If _p_n_a_m_e is GGGGLLLL____SSSSPPPPHHHHEEEERRRREEEE____MMMMAAAAPPPP and _c_o_o_r_d is either GGGGLLLL____SSSS or GGGGLLLL____TTTT, s and t
texture coordinates are generated as follows. Let _u be the unit vector
pointing from the origin to the polygon vertex (in eye coordinates). Let
_n sup prime be the current normal, after transformation to eye
coordinates. Let
T
f = (f f f )
x y z
be the reflection vector such that
T
' '
f = u - 2n n u
_____________________
| 2 2 2
Finally, let m = 2 f + f + (f + 1) . Then the values assigned to
\| x y z
the s and t texture coordinates are
f
x__ 1_
s = +
m 2
f
y__ 1_
t = +
m 2
To enable or disable a texture-coordinate generation function, call
ggggllllEEEEnnnnaaaabbbblllleeee or ggggllllDDDDiiiissssaaaabbbblllleeee with one of the symbolic texture-coordinate names
(GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____GGGGEEEENNNN____SSSS, GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____GGGGEEEENNNN____TTTT, GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____GGGGEEEENNNN____RRRR, or
GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____GGGGEEEENNNN____QQQQ) as the argument. When enabled, the specified texture
coordinate is computed according to the generating function associated
with that coordinate. When disabled, subsequent vertices take the
specified texture coordinate from the current set of texture coordinates.
Initially, all texture generation functions are set to GGGGLLLL____EEEEYYYYEEEE____LLLLIIIINNNNEEEEAAAARRRR and
are disabled. Both s plane equations are (1, 0, 0, 0), both t plane
equations are (0, 1, 0, 0), and all r and q plane equations are (0, 0, 0,
0).
EEEERRRRRRRROOOORRRRSSSS
GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated when _c_o_o_r_d or _p_n_a_m_e is not an accepted
defined value, or when _p_n_a_m_e is GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____GGGGEEEENNNN____MMMMOOOODDDDEEEE and _p_a_r_a_m_s is not an
accepted defined value.
GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated when _p_n_a_m_e is GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____GGGGEEEENNNN____MMMMOOOODDDDEEEE, _p_a_r_a_m_s is
GGGGLLLL____SSSSPPPPHHHHEEEERRRREEEE____MMMMAAAAPPPP, and _c_o_o_r_d is either GGGGLLLL____RRRR or GGGGLLLL____QQQQ.
GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ggggllllTTTTeeeexxxxGGGGeeeennnn is executed between the
execution of ggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ggggllllEEEEnnnndddd.